<!DOCTYPE html>  
<html>
<head>  
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>Hello, World</title>  
<style type="text/css">  
html{height:100%}  
body{height:100%;margin:0px;padding:0px}  
#container{height:100%}  
</style>  
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=kdcrOSQVQVo58B3FA48KlPY6njIHWhoC">
//v2.0版本的引用方式：src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"
</script>
</head>  
 
<body>  
<div id="container"></div> 
 
<script type="text/javascript"> 
// 创建地图实例 
var map = new BMap.Map("container");
// 创建点坐标
 // 初始化地图，设置中心点坐标和地图级
var point = new BMap.Point(116.404, 39.915);
//设置定位按钮位置
var opts = {anchor:BMAP_ANCHOR_BOTTOM_RIGHT}
//设置缩放按钮位置及类型
var ove={anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}
//将定位控件添加到地图上
map.addControl(new BMap.GeolocationControl(opts));
//添加缩放按钮
map.addControl(new BMap.NavigationControl(ove));
</script>  
</body>  
</html>